package com.example.mardan_demo1.mapper;

import com.example.mardan_demo1.pojo.Bgs_list;
import com.example.mardan_demo1.pojo.Bgs_log;
import com.example.mardan_demo1.pojo.User;
import com.example.mardan_demo1.pojo.UserReportLog;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @Author:买尔旦江 ×@CreateTime: 2024-11-22
 * @Description: bgsMapper
 * @Version: 1.0
 */
@Mapper
public interface BgsMapper {
    List<Bgs_list> list(String bgsCode, String bgsName);

    Bgs_list findBgsById(Integer bgs_id);


    void updateStatus(Integer bgsId, String status);

    void createJieYueLog(String userId, String bgsId, LocalDateTime shenQingRiQi, String status, String  j_sq_message , LocalDateTime now);

    List<UserReportLog> shenQingJieYueRiZhi(String status);

    List<UserReportLog> findLogByBgsId(Integer bgsId);

    @Select("select * from user where id = #{user}")
    User findUserById(Integer userId);

    @Select("select * from bgs_log where id =#{bgsLogId}")
    UserReportLog findOneLogByBgsId(Integer bgsLogId);


    void upDateBgsList(Integer bgsId, LocalDateTime now, String status);

    void updateBgsLog(Integer bgsLogId, LocalDateTime now, String status, String clMessage, Integer adminId);

    List<UserReportLog> getOwnList(Integer userId, String message);

    /*
     * @Description: 根据日志id获取日志表中的日志
     * @Author:  买尔旦江
     * @Param String logId
     * @date:  2024/11/24 1:06
     */

    @Select("select * from bgs_log where id = #{logId}")
    Bgs_log findLogByLogId(Integer logId);

    void guiHuanShenQing(Integer logId, String guiHuanStatus, String yongHuGuiHuanShijian, String yongHuGuiHuanYiJian);

    void xinZengJieYueRiZhi(String userId, String bgs_id, String pending, LocalDateTime now);

    void gengXinJieYueRiZhi(Integer logId, LocalDateTime now , String status, Integer adminId);


    List<UserReportLog> guiHuanShenQingLieBiao(String guiHuanStatus);

    void wanChengGuiHuan(Integer logId, Integer adminId, String now);

    List<UserReportLog> guanli_dai_shen(Integer userId);

    List<UserReportLog> countLogs();

    List<UserReportLog> countLogs1();
}
